package bogdan.trainee
import java.util.Scanner;
/**
 * 
 * @author Olexandr Bogdan
 * program divides the two numbers and displays a whole and a residue.
 */
public class Divide {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		print("Введіть ділене: ");
		int divide = scaner(scan);
		print("Введіть дільник: ");
		int divisor = scaner(scan);
		divAndPrint(divide,divisor);
		scan.close();
	}
	
	
	/**
	 * 
	 * @param input 
	 * @return input integer number
	 */
	public static int scaner(Scanner input){
		return input.nextInt();
	}
	
	/**
	 * 
	 * @param string
	 * Method displays input string without line 
	 */
	public static void print(String string){
		System.out.print(string);
	}
	
	/**
	 * 
	 * @param string
	 * Method displays input string with line
	 */
	public static void println(String string){
		System.out.println(string);
	}
	
	/**
	 * 
	 * @param divide
	 * @param divisor
	 * Method divides the dividend by the divisor, and outputs the result on the screen
	 */
	public static void divAndPrint(int divide , int divisor){
		println("");
		println("Розрахунок");
		println("");
		print("_"+divide+" |_"+divisor+"_____");
		println("");
		print(" "+(divide/divisor)*divisor+" | "+(divide/divisor));
		println("");
		println("------");
		println("  "+divide % divisor);
		println("");
		println(divide+" / "+divisor+" = "+divide /divisor +" остача = "+ divide % divisor );
	}
	
	
	
}

